<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Social Mobile</title>
<script>
var chkNative = true;
</script>
<!-- jQuery and jQuery Mobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script	src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>

<link rel="stylesheet" href="css/mobile-style.css" />
<script type="text/javascript" src="js/social-mobile.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>

<style>
#chatmanager-page {
	padding: 0px;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

#preview {
	width: 80%;
	max-width: 100px;
}

#preview img {
	width: 100%;
}

.hiddenfile {
	width: 0px;
	height: 0px;
	overflow: hidden;
}
</style>

</head>
<body>
	<!-- Home -->
	<div data-theme="a" data-role="page" id="change-photo-page">

		<div data-role="header">
			<h1><img src="img/txtssw.png"></h1>
			<a href="javascript:location.href='users.html';" data-icon="back" data-iconpos="notext" data-rel="dialog" data-transition="fade">Voltar</a>
		</div>

		<div data-role="content" style="padding: 0px;">


			<div align="center">
			<!-- 
				<img alt="" src="img/logossw.png"> <br> <img
					src="img/txtssw.png">
 -->
			<form id="frm-login" action="/social-mobile-web/rest/profile/changepwd"  data-ajax="false">
				<div data-role="fieldcontain">
					<label for="dsPassword">Nova Senha </label> <br/> <input name="dsPassword"
						id="dsPassword" placeholder="" value="" type="password">
				</div>
				<div data-role="fieldcontain">
					<label for="dsPasswordConf"> Confirma Senha </label> <br/> <input name="dsPasswordConf"
						id="dsPasswordConf" placeholder="" value="" type="password">
				</div>

				<input id="login-submit" type="submit" value="Alterar Senha">
				
			</form>
			
			<div id="msg-display"></div>

			</div>


		</div>

	</div>
</body>
<script>
/* attach a submit handler to the form */
$("#frm-login").submit(function(event) {

	showLoadingMsg();

	/* stop form from submitting normally */
  event.preventDefault();
 
  /* get some values from elements on the page: */
  var $form = $( this ),
      pwdconf = $form.find( 'input[name="dsPasswordConf"]' ).val(),
      pwd = $form.find( 'input[name="dsPassword"]' ).val(),
      url = $form.attr( 'action' );
 
  /* Send the data using post */
  var posting = $.post( url, { 'dsPasswordConf': pwdconf, 'dsPassword': pwd } );
 
  /* Put the results in a div */
  posting.done(function( data ) {
	if (data == "sucess") {
		$.cookie("pwd", pwd, {expires: new Date(2020, 01, 31, 11, 00, 00)});
		
		location.href = "users.html"
	} else {
		hideLoadingMsg();
		$("#msg-display").html(data);
	}
    
  });
});

</script>
</html>